package tr.edu.yildiz.ce.app_manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tr.edu.yildiz.ce.app_manager.model.AppProxy;
import tr.edu.yildiz.ce.app_manager.model.Application;
import tr.edu.yildiz.ce.app_manager.service.AppProxyService;
import tr.edu.yildiz.ce.app_manager.service.ApplicationService;
import tr.edu.yildiz.ce.app_manager.service.BasicService;
import tr.edu.yildiz.ce.app_manager.service.ServiceProvider;

@Service
public class ServiceProviderImpl implements ServiceProvider{

	@Autowired
	ApplicationService applicationService;
	
	@Autowired
	AppProxyService appProxyService;
	
	public ApplicationService getApplicationService() {
		return applicationService;
	}
	
	@Override
	public AppProxyService getAppProxyService() {
		return appProxyService;
	}

	@Override
	public BasicService getService(Class clazz) {
		if (clazz.equals(Application.class))
			return applicationService;
		else if (clazz.equals(AppProxy.class))
			return appProxyService;
		return null;
	}
	
	
	
	
}
